<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>
</head>
<body>
    <div id="app"> 
        <cpn><button>案例</button></cpn>
        <cpn><span>hahaha</span></cpn>
        <cpn>
            <i>哈哈哈哈哈</i>
            <div>我是div元素</div>
            <p>我是p元素</p>
        </cpn>
    </div>
    <template id='cpn'>
        <div>
            <h2>我是组件</h2>
            <!-- <slot></slot> 什么也没有 上面可以指定-->
            <slot><button>默认值</button></slot>
        </div>
    </template>
    <script>
        const app=new Vue({
            el:'#app',
            data:{},
            methods:{},
            components:{
                cpn:{
                    template:'#cpn'
                }
            }
        });
    </script>
</body>
</html>